﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using Lamex.Interface;
using Lamex.Library.CommonClass;

namespace Lamex.mCost.UI
{
    public partial class frmCOST_Main : frmModuleBase
    {
        public frmCOST_Main()
        {
            InitializeComponent();
            menuStrip1.Text = ModuleNames.mCost; //与AssemblyModuleEntry.ModuleName定义相同
        }

        public override MenuStrip GetModuleMenu()
        {
            return this.menuStrip1;
        }

        private void menuCOST_Component_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Component_Analysis), sender as ToolStripMenuItem);
        }

        private void menuCOST_MO_TP_Test_Click(object sender, EventArgs e)
        {
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Transfer_Package_MO_TP", 0, false, false), sender as ToolStripMenuItem);
            // MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_MO_Transfer_TP), sender as ToolStripMenuItem);
            //}

            // MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Transfer_Package_MO_TP", 0, false, false), sender as ToolStripMenuItem);
            // MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmCOST_TP_Transfer("Transfer_Package_MO_TP", 0, false, false), sender as ToolStripMenuItem);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(Test), sender as ToolStripMenuItem);
        }

        private void menuCOST_User_Authorization_Click(object sender, EventArgs e)
        {
            //MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_User_Authorization), sender as ToolStripMenuItem);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Access_List), sender as ToolStripMenuItem);
        }

        private void menuCOST_Authorization_List_Click(object sender, EventArgs e)
        {
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Cost_User_Authorization", 0, false, false), sender as ToolStripMenuItem);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Access_List), sender as ToolStripMenuItem);
        }

        private void menuCOST_MOTP_Transfer_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_MOTP_Refresh_From_SAP), sender as ToolStripMenuItem);
        }

        private void menuCOST_MOTP_Query_Click(object sender, EventArgs e)
        {
            //DevExpress.XtraEditors.XtraMessageBox.Show("非授权用户", "提示", MessageBoxButtons.OK);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Data_Query), sender as ToolStripMenuItem);
            //因数据已切换到【172.23.134.41】，通用配置窗体满不能跨服务器访问，所以禁用
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Transfer_Package_MO_TP", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuCOST_Human_Daily_Salary_Click(object sender, EventArgs e)
        {
            //DevExpress.XtraEditors.XtraMessageBox.Show("非授权用户", "提示", MessageBoxButtons.OK);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Data_Query), sender as ToolStripMenuItem);
            //因数据已切换到【172.23.134.41】，通用配置窗体满不能跨服务器访问，所以禁用
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Cost_Labor_Comp_Daily", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuCOST_Human_Social_Insurance_Click(object sender, EventArgs e)
        {
            //DevExpress.XtraEditors.XtraMessageBox.Show("非授权用户", "提示", MessageBoxButtons.OK);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_Data_Query), sender as ToolStripMenuItem);
            //因数据已切换到【172.23.134.41】，通用配置窗体满不能跨服务器访问，所以禁用
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Cost_Social_Insurance_Monthly", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuCOST_Material_Scrap_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Cost_Material_Scrap", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuCOST_Human_Data_Import_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmCOST_HR_Data_Refresh), sender as ToolStripMenuItem);
        }

        private void menuCOST_HNI_Calendar_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Cost_HNI_Calendar", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuCOST_101_Inside_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Transfer_101_Inside_record", 0, false, false), sender as ToolStripMenuItem);
        }
    }
}